/*
 * Sesame Inc.
 * Copyright (c) 2009 All Rights Reserved.
 */
package com.sesame.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.sesame.service.AlbumService;

/**
 * @author voidman
 * 
 */

public class DeleteAlbumTagController extends AbstractController {

    private AlbumService albumService;

    public void setAlbumService(AlbumService albumService) {
        this.albumService = albumService;
    }

    protected ModelAndView handleRequestInternal(HttpServletRequest request,
            HttpServletResponse reponse) throws Exception {

        Integer albumTagId = Integer.parseInt(request
                .getParameter("albumTagId"));
        Integer albumId = Integer.parseInt(request.getParameter("albumId"));
        albumService.deleteAlbumTag(albumTagId);

        return new ModelAndView("redirect:albumTag.html?albumId=" + albumId);

    }

}